package gv.trans.dict;

import java.util.ArrayList;
import java.util.StringTokenizer;

public class DataCloud {
	
	static String[][] allLangs;

	public static String[][] allTheLanguages() {
		if(allLangs==null){
			String langs = PHPConnector.execute("allthelanguages");
			ArrayList<String> names = new ArrayList<String>();
			ArrayList<String> codes = new ArrayList<String>();
			StringTokenizer st = new StringTokenizer(langs, ":");
			while(st.hasMoreTokens()){
				names.add(st.nextToken());
				codes.add(st.nextToken());
			}
			int size = names.size();
			allLangs = new String[size][2];
			for(int i = 0; i<size; i++){
				allLangs[i][0]=names.get(i);
				allLangs[i][1]=codes.get(i);
			}
		}
		return allLangs;
	}

}
